home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / rbbs_pc / rbbsdocs.zip / RBBSDOCS.78 < prev    next >
Text File  |  1990-11-09  |  30KB  |  717 lines

  1.  
  2.     7.8 RBBS-PC's "Macro" Command Support
  3.     -------------------------------------
  4.     RBBS-PC's  "macro"  support  expands   a  single  keystroke  into  multiple
  5.     keystrokes.  It allows RBBS-PC to be tailored in even  a greater variety of
  6.     ways  than before  because  a single  command can  be  set up  to invoke  a
  7.     sequence of  multiple  RBBS-PC commands.   The  concept is  similar to  the
  8.     keyboard  macro function found in  many terminal emulators,  except that in
  9.     RBBS-PC   the  SysOp  defines  the  macros  and  the  caller  invokes  them
  10.     transparently without knowing.
  11.  
  12.     Macros add a  new dimension to RBBS-PC  commands -- commands can  be a full
  13.     word rather than just a single letter.   A macro is invoked by a name up to
  14.     8 characters.   For example, "DOOR" and "OPEN" can be used to invoke doors.
  15.     This makes it easy to make all commands  available on a single level, since
  16.     D  could trigger  a download,  while the  word DOOR  will trigger  the door
  17.     function.
  18.  
  19.     Macros can  be used to abbreviate a longer series of commands. If the SysOp
  20.     wants to use "A)bandon conference", all that need be done is to add a macro
  21.     called "A" whose  content is "J M"  (join main).  Or  if N)etmail is to  be
  22.     used to read Fido-net compatible message bases, a macro called "N" could be
  23.     set  up as "D  NETMAIL" (use door  called NETMAIL).  RBBS-PC  thus can have
  24.     UNLIMITED commands.
  25.  
  26.     A string  of RBBS-PC commands can be  stored in a macro  for many different
  27.     types of purposes, including (but not limited to):
  28.  
  29.  
  30.  
  31.     PLANNING YOUR USER INTERFACE                                           7-11
  32.  
  33.  
  34.          setting up demos,
  35.          showing a user what to do rather than just explaining it in words,
  36.          automated testing of RBBS-PC features
  37.  
  38.     Macros can  also be  used to make  the same type  of function  do different
  39.     work.  For example, the  B)ulletin command basically displays a text  file.
  40.     Suppose an association  wants to  let persons order  pamphlets and  preview
  41.     them  on-line.   Rather  than bury  the  ordering function  insider A)nswer
  42.     questionnaire  and the  preview  function inside  B)ulletins, the  commands
  43.     PREVIEW and  ORDER  can be  added  as macros,  where  ORDER stands  for  "A
  44.     ORDWHAT"  AND  "ORDWHAT" is  a submenu  listing what  can be  ordered. Each
  45.     option on the submenu is a questionnaire.  PREVIEW similarly is "B PREWHAT"
  46.     where  "PREWHAT"  is a  submenu listing  the  available pamphlets  that are
  47.     stored as text files.
  48.  
  49.     Macros can be built to  provide interactive help to callers.   For example,
  50.     you can put  up a macro called EZDOWN to help people download.  It explains
  51.     everything, asks for the file name  and protocol, and tells the caller what
  52.     they should be doing on their end, and then drives the download.
  53.  
  54.     Macros   can  be   used  to   provide  integrated   data  bases.     Unlike
  55.     questionnaires, you can totally control how data is written to a file.  You
  56.     can put in  labels, or data only,  put the values  in quotes, separate  the
  57.     values by commas, etc.  This is done by creating a template into which data
  58.     values are written.
  59.  
  60.     Macros  can be used to give  "tours" of your RBBS-PC --  to showcase new or
  61.     special features.
  62.  
  63.     Macros  can  be controlled  via security  level  access, just  like regular
  64.     commands, and they can be forced to operate only in certain contexts.
  65.  
  66.     Macros can be
  67.  
  68.        - invoked anywhere within RBBS-PC -- including questionnaires,
  69.        - unlimited in length,
  70.        - used even when the caller has "turbo" key feature enabled,
  71.        - used with SmartText (see section 7.9),
  72.        - used to store responses that can be manipulated later, and
  73.        - used to support graphics versions of text.
  74.  
  75.     It is important to remember that a macro will be ignored if its name is the
  76.     same as any command.   To replace a command  with a macro, you must  insure
  77.     that the letter  for the command  has been  reassigned.  CONFIG  parameters
  78.     30-34 allow such reassignments to be easily accomplished.
  79.  
  80.     Some contexts  will not accept macros,  such as when RBBS-PC  prompts for a
  81.     search string.
  82.  
  83.     Macro  commands with more than one letter  override all others.  This means
  84.     that  the macro interpretation will prevail if more than one interpretation
  85.     is possible.   For example,  in the  absence of macros  the command  "door"
  86.     would  the interpreted  as the command  "d", so  that saying  "door" in the
  87.     files  section would  be  download.   But a  "DOOR.MCR"  would be  executed
  88.     instead when it  exists.  One  letter commands,  however, will be  executed
  89.     when  they match a command  letter, and so any macros  will be ignored that
  90.     have the same one letter name the same as a command.
  91.  
  92.  
  93.  
  94.     RBBS-PC 17.3A            TECHNICAL REFERENCE MANUAL                    7-12
  95.  
  96.  
  97.     7.8.1 How to Set Up "Macros"
  98.     ----------------------------
  99.     To  use macros,  two CONFIG parameters  must be specified:   the drive/path
  100.     where macro files are  stored (CONFIG parameter 79)  and the extension  the
  101.     macro files will  have (CONFIG parameter  80).  The  defaults are "C:"  and
  102.     "MCR".  To  create a macro named X, simply create  a file with prefix X and
  103.     the macro  extension and place in it the macro  drive/path.  If you are not
  104.     using any macros, RBBS-PC will run faster if you specify NO macro extension
  105.     in CONFIG parameter 80.
  106.  
  107.     The  first line  within a  "macro" controls  access to  the macro,  both by
  108.     security level, and a  limitation on the  scope of the  macro, in which  it
  109.     will be operative, including
  110.  
  111.        - anywhere inside a section
  112.        - anywhere inside a command
  113.        - only at a section and not inside.
  114.  
  115.     The format of the first line is:
  116.  
  117.               <SecLevel>/<constraint>
  118.  
  119.     where <SecLevel>  is the minimum  security required to  run the  macro, and
  120.     <constraint> is the  section (M for main, F  for file, U for utility,  or @
  121.     for library)  and command  letter the  macro is confined  to (use  original
  122.     command letter, not the reassigned ones).  For example
  123.  
  124.               4/M
  125.  
  126.     means  that security level  4 is  required, and the  macro runs  only at or
  127.     inside the main section prompt.
  128.  
  129.               5/MB
  130.  
  131.     means  that security  level 5  is required and  the macro  runs only  at or
  132.     inside the main section bulletin command.  Thus the macro file 1.mcr
  133.  
  134.               2/MJ
  135.               {EN
  136.               RBBS
  137.  
  138.     means that when inside the main  J)oin, the text "RBBS" will be substituted
  139.     for "1".   (So "J 1" does  the work of "J  RBBS".)  The "{EN"  means not to
  140.     echo what the macro substitutes (user does not see "RBBS").
  141.  
  142.     To make a macro  operative only at a section prompt and not inside, add a "
  143.     /" to the end of the section constraint.  For example,
  144.  
  145.               4/M /
  146.  
  147.     means that the macro applies only at the main section prompt.  For example,
  148.     the macro SP.MCR
  149.  
  150.               4/M /
  151.               {EN
  152.               J SEMIPRV
  153.  
  154.     will  substitute "J SEMIPRV" for "SP" when at  the main prompt, but NOT for
  155.     "SP" inside the message read command ("R SP L").
  156.  
  157.  
  158.  
  159.     PLANNING YOUR USER INTERFACE                                           7-13
  160.  
  161.  
  162.     Note:  a macro will be ignored if its name is the same as a command symbol.
  163.     To use  1, 2, 3, etc.  for macro commands,  you must disable  or substitute
  164.     other symbols for the SysOp commands.
  165.  
  166.     The first line  of a macro  must be the minimum  security level to  use the
  167.     macro.   The macro will  simply be ignored  if the caller  has insufficient
  168.     security.  The second line  will be parsed and replace the macro name.  The
  169.     remaining lines will be read from disk and processed as required.
  170.  
  171.     Macro commands have the same structure as SmartText variables:
  172.  
  173.          <command prefix><command name>
  174.  
  175.     where <command prefix> is the  SmartText command specified in CONFIG.   The
  176.     symbol "{" (ASCII 123)  is the default.  The <command name> consists of two
  177.     characters.  Lines that are  not valid macro commands are simply  passed to
  178.     RBBS-PC  as if the  user had  typed them in.   There  are three differences
  179.     between SmartText variables and macro commands:
  180.  
  181.     (1)  Macro commands must be the first  three characters on a line,  whereas
  182.          SmartText variables can occur anywhere on a line.
  183.  
  184.     (2)  Macro commands can have an argument after the command name, and(
  185.  
  186.     (3)  A macro command can apply to a block of lines following it.
  187.  
  188.     7.8.2 Macro Commands
  189.     --------------------
  190.     RBBS-PC "Macro" Commands include the capability of having commands executed
  191.     within  the "macro" rather than  simply passing keystrokes  to RBBS-PC.  In
  192.     all prompts and blocks,  substitution is supported for both  stored answers
  193.     SmartText  variables.  The following  is a  list  and description  of valid
  194.     "macro" commands:
  195.  
  196.     *0 - display what follows on the line with no carriage return.
  197.     *1 - display what follows on the line with a carriage return.
  198.     *B - display what follows on subsequent lines.
  199.     *F - display the named file that follows.
  200.     nn - display a prompt and store result in work variable nn.
  201.     WT - pause for the number of seconds specified after "WT".
  202.     >> - append the following block of text to the file specified.
  203.     ST - Stack the characters immediately following the "ST".
  204.     M! - Execute the named macro that follows on the same line.
  205.     ON - Case logic for branching within macros based on stored results.
  206.     EY - Echo the text passed in macros as keystrokes.
  207.     EN - Do not echo the macro keystrokes.
  208.     << - Display fields from a file in a form.
  209.     := - Assign value to a work variable
  210.     LV - Verify that answer of one in a list
  211.     NV - Verify that answer is between two integers
  212.     CV - Verify that answer is between two character values
  213.     LO - Set location for Fast File Searches for download, upload, view
  214.  
  215.     The syntax and an example of each command follows:
  216.  
  217.     *0 - display what follows on the line with no carriage return.
  218.  
  219.               {*0Press any key to continue
  220.  
  221.  
  222.  
  223.     RBBS-PC 17.3A            TECHNICAL REFERENCE MANUAL                    7-14
  224.  
  225.  
  226.     *1 - display what follows on the line with a carriage return.
  227.  
  228.               {*1{FN, I hope you enjoyed your tour of the board!
  229.  
  230.          The  caller's  first name  is substituted  for the  SmartText variable
  231.          "{FN."
  232.  
  233.     *B - display  what follows on subsequent  lines, each line  with a carriage
  234.          return, up to the line beginning with "{END".
  235.  
  236.               {*B
  237.               This is  an example  of a  macro's  ability to  display
  238.               multiple lines.  The macro command is
  239.               {*B
  240.               and  it will display all lines  until it encounters one
  241.               beginning with {END.  Like it, {FN?
  242.               {END
  243.  
  244.          The caller will seen everything between the first and last lines, with
  245.          the first name substituted into the last line displayed.
  246.  
  247.     *F - display the named file that follows.
  248.  
  249.               {*F L:\RBBS\HELP.LST
  250.  
  251.          will display the file HELP.LST.
  252.  
  253.     nn - use the text that follows on the line as a prompt and store the answer
  254.          in an  internal working variable numbered  nn.  nn must  be two digits
  255.          and  can be 01,  02, 03,  ..., 99.   CONFIG parameter  94 controls the
  256.          maximum # of work variables.
  257.  
  258.               {01Please enter the Department you work for:
  259.               {02Please enter your Office number:
  260.  
  261.          This will store the answers in  work variable # 1 and 2, which  can be
  262.          subsequently referenced as "[1]" and "[2]".  You can have as many work
  263.          variables as specified  in CONFIG  parameter 94.   Variables that  are
  264.          reused have their values overwritten.
  265.  
  266.     WT - pause for the number of seconds specified after "WT".
  267.  
  268.               {WT 2
  269.  
  270.          will wait for 2 seconds.
  271.  
  272.     >> - append the following block of text to the file specified on this line.
  273.  
  274.               {>> C:MACRO.DAT
  275.               "{FN","{LN","[1]","[2]"
  276.               {END
  277.  
  278.          will append the  following line to the  file named MACRO.DAT  on drive
  279.          C:, assuming the caller is KEN  GOOSENS, and he responded to the above
  280.          prompts for  Department  with "Controller"  and Office  # with  "107".
  281.          Then the line what would be written out is:
  282.  
  283.               "KEN","GOOSENS","Controller","107"
  284.  
  285.  
  286.  
  287.     PLANNING YOUR USER INTERFACE                                           7-15
  288.  
  289.  
  290.          As many lines can be included as desired.   Simply end the block to be
  291.          written out with "{END" as the beginning of the line.
  292.  
  293.          Some  data base managers want fixed length  files and this is possible
  294.          in the  macro append.    Just add  "/FL" on  the  macro command  line.
  295.          Rather than replace,  the substitution  will overlay the  line at  the
  296.          "[",  thus keeping  the output fixed  length.   Lets suppose  that the
  297.          first  work variable has "A" as a  value, the second work variable has
  298.          the value "123456",  the third work variable  has "Henry" as  a value,
  299.          and the caller's first name is KEN.  Then
  300.  
  301.               {>> C:\RBBS\DAT.FIL /FL
  302.               [1][2]....[3]...............{FN........
  303.               {END
  304.  
  305.          would add the following line into DAT.FIL
  306.  
  307.               A  123456.Henry.............KEN.........
  308.  
  309.          Normally, blanks would be put where dots are show.
  310.  
  311.     ST - Stack the characters immediately following the "ST".
  312.  
  313.               {ST
  314.  
  315.          will stack a carriage return (no characters).  And
  316.  
  317.               {STD [1] [2]
  318.  
  319.          would  stack "D  RBBS-EXE.ARC Z"  - as  if they  were typed  and ENTER
  320.          pressed - if  the first work variable had "RBBS-PC.EXE" and the second
  321.          work variable held "Z".  It is important to note that  "macros" are so
  322.          transparent to  RBBS-PC that if you  use macros to display  text at an
  323.          RBBS-PC  prompt like "Enter command?  ", RBBS-PC will  continue to sit
  324.          there waiting for  an answer.   A stacked carriage  return at the  end
  325.          will cause  the prompt  to be  redisplayed, though the  effect of  the
  326.          stack will vary with the particular prompt.
  327.  
  328.     M! - Execute the named macro that follows on the same line.  E.g.
  329.  
  330.               {M! ORDER
  331.  
  332.          will execute the macro called  ORDER.  RBBS-PC does NOT return  to the
  333.          invoking macro when the named macro is complete.  Also,  The full file
  334.          name of the  macro to execute is not here  used (i.e. ORDER.MCR), only
  335.          the file prefix -- ORDER.
  336.  
  337.          As  is shown in the example of the ON command, the macro name can have
  338.          a drive/path  and/or extension.  If  only a prefix is  put in, RBBS-PC
  339.          will  automatically  add  the  drive/path  and  extension  for  macros
  340.          specified in  CONFIG parameter  79  and parameter  80.   Putting in  a
  341.          drive/path/extension that  is different from CONFIG's  assures that no
  342.          caller can invoke the macro -- it only can be used internally  by your
  343.          application.
  344.  
  345.     ON - Case logic for macros.  This allows responses to be tested against and
  346.          branching logic developed within a "macro".  An example would be:
  347.  
  348.               {ON 1
  349.  
  350.  
  351.  
  352.     RBBS-PC 17.3A            TECHNICAL REFERENCE MANUAL                    7-16
  353.  
  354.  
  355.               {==A
  356.               {M! D:\HIDDEN\CHOICEA.MCR
  357.               {==B
  358.               {*1You have selected option B
  359.               {02Why did you select B?
  360.               {==C
  361.               {M! D:\HIDDEN\CHOICEA.MCR
  362.               {END ON
  363.  
  364.     EY - Echo  the text passed in  macros as if keystrokes.   The default is to
  365.          echo.
  366.  
  367.     EN - Do not echo the macro keystrokes.  An example would be:
  368.  
  369.               {EN
  370.               {*1 The following commands will be executed but now shown
  371.               {01 Press Enter when ready
  372.               R L
  373.               A
  374.               {EY
  375.               {*1 now you will see the responses to the prompts
  376.               {01 Press Enter when ready
  377.               R L
  378.               A
  379.  
  380.     << - Display fields  from a  file  in a  form.   This is  one  of the  most
  381.          powerful macro commands.  It allows data to be stored in compact, data
  382.          format but retrieved into a  form for display to a caller.   There are
  383.          5 parameters that can follow the macro command:
  384.  
  385.          <file name> <file format> <data#> <submode> <rec-pause>
  386.  
  387.           where:
  388.  
  389.          "<file name>" is the name of the data file that has records to read,
  390.  
  391.          "<file format>" is "/V"  if data is stored  in variable length  format
  392.          and "/F" if fixed length format,
  393.  
  394.          "<data#>" is the  number of separate  fields in a record  for variable
  395.          length data and the length of the data if fixed length,
  396.  
  397.          "<submode>" is the mode used to  substitute data in the following form
  398.          "/FL" if the form is fixed length, meaning that data  is overlaid into
  399.          the form so as not to change any lengths.
  400.  
  401.          "<rec-pause>" should  be "/1" if you  want to pause  after each record
  402.          rather than when the screen fills.
  403.  
  404.          An example of a "macro" that uses this capability is as follows:
  405.  
  406.     {*1 -TOPIC-    - DATA # -       - VOICE # -    -First Name-    -Last Name-
  407.     {<< C:\RBBS\RHLP.DAT /V 5 /FL
  408.     [1]         [2]              [3]             [5]             [4]
  409.     {END
  410.  
  411.     Note that spaces occur after the "[4]".  If the file RHLP.DAT contains
  412.  
  413.     "DOORS","703-978-6360","0","Ken","Goosens"
  414.  
  415.  
  416.  
  417.     PLANNING YOUR USER INTERFACE                                           7-17
  418.  
  419.  
  420.     "PROTOCOLS","407-627-6969","407-627-9767","Doug","Azzarito"
  421.  
  422.     then the caller would see
  423.  
  424.      -TOPIC-    - DATA # -       - VOICE # -    -First Name-    -Last Name-
  425.     DOORS       703-978-6360     0               Ken             Goosens
  426.     PROTOCOLS   407-627-6969     407-627-9767    Doug            Azzarito
  427.  
  428.     The same example using fixed length data would be
  429.  
  430.     {*1 -TOPIC-    - DATA # -       - VOICE # -    - Name -
  431.     {<< C:\RBBS\RFLH.DAT /F 69 /FL
  432.     [1](34:12)    [1](46:12)       [1](58:12)      [1](1:33)
  433.     {END
  434.  
  435.     where RFLH.DAT contains:
  436.  
  437.     Ken Goosens                      DOORS       703-978-63600
  438.     Doug Azzarito                    PROTOCOLS   407-627-6969407-627-9767
  439.  
  440.     This would produce the following for the caller:
  441.  
  442.      -TOPIC-    - DATA # -       - VOICE # -    - Name -
  443.     DOORS       703-978-6360     0               Ken Goosens
  444.     PROTOCOLS   407-627-6969     407-627-9767    Doug Azzarito
  445.  
  446.     Note that work fields support sub-field references in the format:
  447.  
  448.               [n](x:y)
  449.  
  450.     where n is the work field number,  "x" is the beginning column, and "y"  is
  451.     the # of  bytes to  get.  If  work field  two had a  value "123abcde"  then
  452.     "[2](3:4)" would have "3abc" as its value.  Fixed length records are always
  453.     referenced as work variable one.
  454.  
  455.     := - Assign a  value to a work variable.   Work variables can be assigned a
  456.          value inside a macro.  The command to do this is ":=".  E.g.
  457.  
  458.               {:= 5 OK
  459.  
  460.          assigns string "OK" to work variable 5.
  461.  
  462.     LV,  NV, and CV  - Macros can edit  the responses to  questions.  Edits can
  463.     constrain the answer to
  464.  
  465.          - one of a list
  466.          - a numeric value between two values
  467.          - a character value between two values
  468.  
  469.          An editing  constraint  must be  put  in  front of  the  actual  macro
  470.          question  it applies  to, and a  constraint applies  only to  the next
  471.          question and does not remain operative.
  472.  
  473.          The  commands for  these  are respectively  "LV"  (List Verify),  "NV"
  474.          (Numeric Verify), and "CV"  (Character Verify).  The list  verify uses
  475.          the first character  after the  command as a  delimiter between  valid
  476.          responses.  E.g.  "{LV;R;A;E;" means that only "R",  "A", and "E" will
  477.          be  accepted as  answers ("{LV/R/A/E/"  would have  the same  effect).
  478.  
  479.  
  480.  
  481.     RBBS-PC 17.3A            TECHNICAL REFERENCE MANUAL                    7-18
  482.  
  483.  
  484.          Semi-colon  is  the best  delimiter in  general  because it  cannot be
  485.          entered as a value.
  486.  
  487.          Numeric and Character verify  check inclusive ranges.  Thus "{NV 7 11"
  488.          will accept 7, 8, 9, 10, or 11.   The numeric value must be an integer
  489.          between -32,768 and 32,767.  To  accept answers B through E, the macro
  490.          edit command is "{CV B E".
  491.  
  492.          Whenever an answer fails  an edit, the message "Invalid  answer <...>"
  493.          is given with the  answer received between brackets, and  the question
  494.          is asked again.  An example of a macro with edits is:
  495.  
  496.               4
  497.               {*1 Verification macro
  498.               {*1 now checking list...
  499.               {LV;A;F;W;
  500.               {01 Enter A, F, or W
  501.               {*1 now testing numeric range...
  502.               {NV 5 15
  503.               {01 Enter a number between 5 and 15
  504.               {*1 now testing character range...
  505.               {CV D J
  506.               {01 Enter a character between D and J
  507.  
  508.     LO - Sets  location  that a  file  is  to be  searched  for  in an  upload,
  509.          download, or view  request.   Followed  by a drive path.   Useful when
  510.          want  to have a macro execute  in front of a download  or upload for a
  511.          file  which is really  available (see section 12.9).   Applies only to
  512.          Fast File Search.  For example,
  513.  
  514.               {LO  F:\DF1\
  515.  
  516.          would set the file location to drive F subdirectory DF1.
  517.  
  518.     7.8.3 A Sample Macro
  519.     --------------------
  520.     Suppose A)bandon conference is to  be implemented in RBBS-PC.  To  do this,
  521.     the  command A)nswer  questionnaires must be  assigned a  different letter.
  522.     Else A will always invoke answer instead.  Then the macro file could
  523.     contain
  524.               5
  525.               J M
  526.  
  527.     The command "A" will  then be followed by "Rejoining MAIN".   Incidentally,
  528.     if the macro had been implemented by
  529.  
  530.               5
  531.               J
  532.               M
  533.  
  534.     The only  difference is that the prompt for what conference to join will be
  535.     displayed, "M" then would  be displayed as if the caller  had typed it, and
  536.     then main would be rejoined.  The difference is caused by the fact that the
  537.     first line after the  security level is what replaces the macro name, so in
  538.     the first case "M" preempts the prompt but not in the second.
  539.  
  540.  
  541.  
  542.     PLANNING YOUR USER INTERFACE                                           7-19
  543.  
  544.  
  545.     7.8.4 On-line Data Base With Macros & Questionnaires
  546.     ----------------------------------------------------
  547.     RBBS-PC provides the  SysOp with the ability to offer  callers access to an
  548.     on-line  database both  internally  (using macros  and questionnaires)  and
  549.     externally to RBBS-PC (see Appendix R).
  550.  
  551.     RBBS-PC's internal Remote Data Base feature gives the SysOp the ability to:
  552.  
  553.        - set up unlimited numbers of named data bases
  554.        - set up menus to interact with the user
  555.        - prompt users for data
  556.        - use Metavariables - both work variables and SmartText variables.
  557.        - store user's  answers  in work  variables.   Any  subfield  in a  work
  558.          variable can be referenced.
  559.        - display, or store all metavariables
  560.        - process commands conditionally
  561.        - save  Metavariables to  file through  templates, allowing  data  to be
  562.          stored in virtually any format desired
  563.        - retrieve data into templates for display.
  564.        - do full screen data entry
  565.  
  566.     RBBS-PC's support  for "full screen"  questionnaires and macros  takes some
  567.     work on the SysOp's  part.  The SysOp must  use ANSI screen commands.   The
  568.     SysOp must then arrange to transmit the "template" that clears the  callers
  569.     screen and  writes the appropriate static text (lines, labels, etc.) on the
  570.     callers  screen.  Then the data the user  is to see is transmitted onto the
  571.     caller's screen.   The "full screen"  support does not allow  the caller to
  572.     use keys like tab  and cursor arrows to move  around on the screen.   It is
  573.     "full screen" in the sense that the caller sees  all the data that is to be
  574.     entered and the cursor moves from field to field.
  575.  
  576.     On-line Database Example
  577.     ------------------------
  578.     This  application manages a  data base of  callers who are  willing to help
  579.     with RBBS-PC  by topic.  It is controlled at  a high level by the following
  580.     questionnaire.
  581.  
  582.     C:DUMMY.DAT,4
  583.     * This questionnaire is for finding help with RBBS-PC by topic.
  584.     * Please register yourself if you
  585.     *   -  are willing to help others, and
  586.     *   -  know enough about a topic to help
  587.     *
  588.     * Examples of topics people need help with:
  589.     *   Desqview       Modem models (HST, Everex, USR Internal, etc.)
  590.     *   PC-Slaves      Protocols     Conferences    FMS
  591.     *   Doors          DoubleDos     Sub-boards     PUI
  592.     *   Questionnaires 10-Net        Macros         Uploads
  593.     *   MU-Purge       File maint.   Personal dnld  Caller Analysis
  594.     *
  595.     :-[prompt]-
  596.     T
  597.     ? V)iew database, E)nter new data, Q)uit (V,A,Q)
  598.     =V-[view]-=E-[add]-=Q-[quit]-= -[prompt]-
  599.     :-[view]-
  600.     M C:\RBBS\VIEWHELP.MCR
  601.     >-[prompt]-
  602.     :-[quit]-
  603.     @
  604.  
  605.  
  606.  
  607.     RBBS-PC 17.3A            TECHNICAL REFERENCE MANUAL                    7-20
  608.  
  609.  
  610.     :-[add]-
  611.     *                  703-978-6360
  612.     ?1 BBS data number
  613.     *                                   703-978-4339
  614.     ?2 Voice # (evening, 0 not to give)
  615.     * You can specify as many topics as desired, one at a time.
  616.     *
  617.     :-[topic]-
  618.     ?3 RBBS-PC topic you will help others with, or Q)uit
  619.     =Q-[prompt]-= -[addrec]-
  620.     :-[addrec]-
  621.     * -Topic-         - Data # -      - Voice # -   Last Name       First Name
  622.     */FL[3]              [1]             [2]            {LN             {FN
  623.  
  624.     T
  625.     ?Really add this record (Y,N)
  626.     =Y-[really]-=N-[topic]-= -[addrec]-
  627.     :-[really]-
  628.     M C:\RBBS\ADDHELP.MCR
  629.     >-[topic]-
  630.  
  631.     Two macros are used by this questionnaire:
  632.     VIEWHELP.MCR for displaying the data base, and
  633.     ADDHELP.MCR for appending new data to the data base.
  634.  
  635.     VIEWHELP.MCR contains
  636.  
  637.     5
  638.     {*1 -Topic-          - Data # -       - Voice # -    Last Name        First
  639.     Name
  640.     {*F RBBSHELP.DAT
  641.  
  642.     ADDHELP.MCR contains
  643.  
  644.     5
  645.     {>> RBBSHELP.DAT /FL
  646.     [3]              [1]             [2]            {LN             {FN
  647.     {END
  648.  
  649.     Full Screen Example
  650.  
  651.     Full screen is available only in a color graphics version of questionnaires
  652.     and macros.   A long application for collecting BBS information is given in
  653.     these following files:
  654.  
  655.     REGRBBS.DEF  - Questionnaire driver, TTY version
  656.     REGRBBSC.DEF - Color graphics version of questionnaire driver
  657.     VUNRBBS.MCR  - View data base macro, TTY version
  658.     VUNRBBSC.MCR - View data base macro, Color graphics version
  659.     SVRBBS.MCR   - Macro to save data to a comma separated data file
  660.  
  661.     These files can  generally be  download from most  bulletin board  systems.
  662.     However,  they are definitely available  on Ken Goosens'  RBBS-PC system at
  663.     (703) 978-6360.
  664.  
  665.     Hints for Building Remote Data Base Applications
  666.     ------------------------------------------------
  667.     Generally you will have:
  668.  
  669.  
  670.  
  671.     PLANNING YOUR USER INTERFACE                                           7-21
  672.  
  673.  
  674.        - a  questionnaire  driver  that  gives  caller  option  to  exit,  view
  675.          database, or Enter new data
  676.        - a macro to retrieve data from file to a form
  677.        - a macro to save data in a data base format
  678.        - a data entry routine in the questionnaire.
  679.  
  680.     Creating  a "full-screen" application is more complicated that than a line-
  681.     at-a-time  (i.e. TTY) application.   For full-screen applications, you will
  682.     want to:
  683.  
  684.        - paint a template with everything but the data values, such  as row and
  685.          column labels and titles.
  686.        - clear  out the  existing values  in a  form and  then put  in the  new
  687.          values.
  688.  
  689.     Only the changes to  the screen are transmitted rather  than retransmitting
  690.     the entire screen when only a part changes.
  691.  
  692.     ANSI  commands are used to control the screen.   Where [ESC] stands for the
  693.     one-character Escape (ASCII 27), the most useful ANSI commands to know are:
  694.  
  695.      [ESC][2J    - clear the screen.
  696.  
  697.      [ESC][K     - clear from current cursor  position to end of line.   Cursor
  698.                    position after clearing is same as before.
  699.  
  700.      [ESC][X;Yf  - position  the  cursor  on   row  x  and  column  Y.     E.g.
  701.                    "[ESC][5;10f" positions on column 10 of row 5.
  702.  
  703.     Case is  significant in ANSI  commands, so beware  that "[ESC][k" will  NOT
  704.     clear to end of line, and "[ESC][1;7F" will not position the cursor.
  705.  
  706.     You  can use ANSI commands to set color  and blink characters.  An easy way
  707.     consistent with RBBS-PC is to set colors using the  SmartText variables C0,
  708.     C1,  ...,  C4, where  1-4  are  the colors  set  in  CONFIG parameter  323,
  709.     parameter 324, parameter 325, and parameter 326.  C0 is "emphasis off," and
  710.     restores  normal text  color preference  of the  caller.   An  example that
  711.     clears the  screen, sets color to 1, positions on line 1, column 15, prints
  712.     "-Sample  Title-", sets color to caller's text preference, prints 2 spaces,
  713.     and then prints value of work variable 1 is as follows:
  714.  
  715.     [ESC][2J{C1[ESC]1;15f-Sample Title-{C0  [1]
  716.  
  717.